package com.transaction.dao;


import com.transaction.domain.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDao {

    @Select("SELECT * FROM user WHERE uid=#{uid} AND upwd=#{upwd}")
    User findUserById(User user);

    @Select("SELECT * FROM user WHERE uid=#{uid}")
    User findUserInfo(User user);

    @Insert("INSERT INTO user (uid,uname,usex,upwd) VALUES (#{uid},#{uname},#{usex},#{upwd})")
    Integer userRegist(User user);

    @Update("UPDATE user SET uname=#{uname},usex=#{usex},upwd=#{upwd} WHERE uid=#{uid}")
    Integer updateUser(User user);

    @Select("SELECT * FROM user WHERE uid=#{uid} AND upwd=#{upwd}")
    User userLogin(User user);
}
